
package com.mephi.interfaces;


import java.util.Map;
import com.mephi.util.PieceLoaderKey;


/**
 * Interface used to describe the postion of the pieces in the game from the beginning.
 * 
 * @author mephisto
 * 2011-07-26
 */
public interface Position
{
	/**
	 * Indicates whether position is starting.
	 * 
	 * @return true it position is the starting positon
	 */
	boolean isStartingPosition();
	
	/**
	 * Sets if the position of chess pieces is starting.
	 *  
	 * If you set true, the position of all pieces are reset and getBlackPosition,
	 * getWhitePosition returns an empty map (with no entry).}
	 * 
	 * @param isStarting to set if the position of chess pieces is starting. 
	 */
	void setStartingPosition(boolean isStarting);
	
	/**
	 * 
	 * @param positionMap the positionMap of white to set. One entry has form ["g2", wK].
	 * 
	 * @throws NullPointerException if positionMap is null
	 * @throws IllegalStateException if positionMap is empty
	 */
	void setWhitePosition(Map<String, PieceLoaderKey> positionMap);
	
	/**
	 * Returns the map with position of white chess pieces.
	 * 
	 * It return empty map if position is starting.
	 * 
	 * @return the map with position of white chess pieces.
	 */
	Map<String, PieceLoaderKey> getWhitePosition();
	
	/**
	 * 
	 * @param positionMap the positionMap of black to set. One entry has form ["c8", bK].
	 * 
	 * @throws NullPointerException if positionMap is null
	 * @throws IllegalStateException if positionMap is empty
	 */
	void setBlackPosition(Map<String, PieceLoaderKey> positionMap);
	
	/**
	 * Returns the map with position of black chess pieces.
	 * 
	 * It return empty map if position is starting.
	 * 
	 * @return the map with position of black chess pieces.
	 */
	Map<String, PieceLoaderKey> getBlackPosition();
}
